test(scoring): cover model.ts's unpinned-fallback and language-fetch-failed warning branches#8499
Conversation
…failed warning branches Asserts the unpinned-ref fallback warning text on the existing SHA-fetch-fails case, and adds a case where constants succeed but the language-weights fetch fails, covering the previously-unexercised warnings.push + empty-map fallback.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Caution 🛑 LoopOver review result - fixes requiredReview updated: 2026-07-24 16:27:16 UTC
Review summary Nits — 4 non-blocking
CI checks failing
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests-merge)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
Summary
src/scoring/model.ts'srefreshScoringModelSnapshotpushes two operator-facing warning strings onto itswarningsarray when a fetch degrades. Both had real branch-coverage gaps intest/unit/scoring.test.ts:refreshed.warnings— the sole operator-facing signal that scoring is currently unpinned had zero coverage.constants.pyandprogramming_languages.jsonsucceed, or hadconstants.pyfail first (short-circuiting the function before this line is ever reached). No test combined "constants succeed, languages fail."refreshed.warningscontains the unpinned-ref message.constants.pysucceeds with a valid body,programming_languages.json404s — assertssourceKind === "raw-github",programmingLanguages === {}, and the fetch-failed warning text.src/scoring/model.tschanged.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpx tsc --noEmit(scoped, exact roottsconfig.jsoncompiler flags) ontest/unit/scoring.test.ts,src/scoring/model.ts,src/env.d.ts,worker-configuration.d.ts— cleannpm --workspace @loopover/engine run build(fresh dist so@loopover/engineresolves in the scoped checks)npx vitest run test/unit/scoring.test.ts— 89/89 passing (2 new)npx vitest run test/unit/scoring.test.ts --coverage --coverage.include='src/scoring/model.ts' --coverage.all=false— 100% statements/lines/functions; the one remaining uncovered branch (scoringUpstreamConfig's||fallbacks, lines 33-34) is pre-existing and untouched by this diffIf any required check was skipped, explain why:
npm run typecheck/npm run test:coverage(unsharded) OOM in this sandbox regardless of diff size — a known sandbox resource constraint, not a signal about this change. Verified instead via the scoped typecheck and scoped coverage run above, isolating exactly the touched file.Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.UI Evidence
This is a backend test-only change with no rendered UI delta — before and after are the same production capture at each required viewport.
apps/loopover-uiis dark-mode-only, so only the Dark row per viewport applies.Notes
src/scoring/model.tsre-exports the pure constants/classifier logic frompackages/loopover-engine/src/scoring/model.ts(feat(miner-foundation): extract scoring preview/model modules into gittensory-engine #2282);refreshScoringModelSnapshotitself is Cloudflare/D1-bound and stays insrc/scoring/model.ts, which is where both newly-covered warning branches live.